package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class DerivedColumn implements SelectSublist {

    private int beginIndex;
    private int endIndex;
    private ValueExpression valueExpression;
    private AsClause asClause;

    public DerivedColumn(ValueExpression valueExpression, AsClause asClause) {
        this.beginIndex = valueExpression.getBeginIndex();
        this.endIndex = valueExpression.getEndIndex();
        if (asClause != null) {
            this.endIndex = asClause.getEndIndex();
        }
        this.valueExpression = valueExpression;
        this.asClause = asClause;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public ValueExpression getValueExpression() {
        return valueExpression;
    }

    public AsClause getAsClause() {
        return asClause;
    }

}
